package com.juku2024.juku.db.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.juku2024.juku.db.entity.HomeGenreModel;


@Dao
public interface HomeGenreDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(HomeGenreModel entity);

    @Update(onConflict = OnConflictStrategy.REPLACE)
    int update(HomeGenreModel entity);

    @Query("DELETE FROM homeGenre")
    void delete();

    @Query("DELETE FROM homeGenre WHERE genreId=:genreId")
    void delete(long genreId);

//    @Query("SELECT * FROM homeGenre WHERE version=:version AND genreId=:genreId")
//    HomeGenreModel query(Long genreId, int page, long version);

    @Query("SELECT * FROM homeGenre WHERE genreId=:genreId")
    HomeGenreModel query(long genreId);
}
